#ifndef prs_Form_H
#define prs_Form_H

#include "prs_FrmUseTemplate.h"
#include "prs_FrmChildren.h"

namespace prs {

///////////////////////////////////////////////////////////////////////////////

struct TNodeForm : public TNodeFrmControl
{
  DECLARE_ClientNode()
  //
  TAttrNodeType<nodeType_Form> NodeType;
  //
  TNodeForm() : NodeType(this) {}
  //
  TNodeUseTemplate *SearchUseTemplateByDefTemplateId(const svl::TString &DefTemplateId);
};

///////////////////////////////////////////////////////////////////////////////

struct TRuleForm : public snt::TRule
{
  TRuleForm(
    snt::text::TContext &Context,
    svl::TVariant &VParentNode,
    TRuleSetNodeIdNecessarily &RSetNodeIdNecessarily,
    TRuleSetNodeIdOptionally  &RSetNodeIdOptionally,
    TRuleFrmGeom &RFrmGeom,
    TRuleSetAttrValue &RSetAttrValue,
    TRuleFrmValue &RFrmValue,
    TRuleSetStyle &RStyle,
    TRuleFrmChildren &RChildren
  );
  
private:  
  static TRuleForm &GetThis(svl::TVariant &VThis) { return *dynamic_cast<TRuleForm*>(VThis.Pointer()); }
  TNodeForm &GetNode();
  //
  svl::TVariant &vParentNode,vThis;
  TRuleUseTemplate RUseTemplate;
  snt::TRule  RAttr;
  snt::TAlter AAttr;
  svl_Except;
};

///////////////////////////////////////////////////////////////////////////////
}

#endif
